Ext.define('Mis.view.menusolution.MenuSolutionGrid', {
    extend:'Ext.tree.Panel',
    alias:'widget.menuSolutionGrid',
    commonUtil : Ext.create("util.commonUtil"),
    modelId : 'cdfa',
    useArrows:true,
	rootVisible: false,
    fieldkey:'id',
    fieldparentkey:'parent',
    store:Ext.create('Mis.store.menusolution.MenuSolutionStore'),
    multiSelect:true,
    singleExpand:true,
    columnLines:true,
    rowLines:true,
    columns:[
        {
            xtype:'treecolumn',
            header:'模块名称',
            dataIndex:'text',
            flex:2,
            renderer: function (value, rec) {
            			console.info(rec.record.raw.leaf)
                        if (value) {
                        	if(rec.record.raw.leaf=='false'){
                        		return value;
                        	}else{
                            	return '<input id="' + rec.record.raw.id + '" type="checkbox">' + (value);
                        	}
                        }
                    }
        },
        {
            header:'操作',
            dataIndex:'buttons',
            flex:3,
            renderer: function (value, rec) {
					    if (value) {
					        var index = value.split(","); //分割符 , 的位置
					        if (index[0] == null || index[0] == "undefined" || index[0].length < 1) {
					            return;
					        }
					        var content = ""; //需要添加到check中的内容 
					        for (var i = 0; i < index.length; i++) {
					            var view = index[i].split('^'); //显示值
					            if (view != null) {
					                content += '<input id="' + rec.record.raw.id + '^' + view[0] + '" type="checkbox">' + view[1];
					            }
					        }
					        return content;
					    }
					}
        }
    ],
    initComponent:function () {
        this.tbar = this.commonUtil.getToolBarButton(toolJson,this.modelId);
        this.callParent(arguments);
    }
});